package com.example.cwgl.configs;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/*配置类，主要用于配置 Web MVC 相关的拦截器和路径匹配规则。*/
@Configuration
public class SessionConfiguration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //会话拦截器（可能用于会话验证/管理）
        registry.addInterceptor(new SessionInterceptor()).addPathPatterns("/**");
        // 日志记录拦截器
        registry.addInterceptor(new LoggerInterceptor()).addPathPatterns("/**");
    }

    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
    }
}
